package homework;

public class MatchesDemo {
    public static void main(String[] args) {
        String email="507792303@qq.com";
        boolean b=email.matches("[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+");
        if(b){
            System.out.println("邮箱格式正确");
        }else{
            System.out.println("邮箱格式错误");
        }
    }
}
